﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using SevenInvaders.common;

namespace SevenInvaders.LEVEL_CAIOZ
{
    class Level_Caio
    {
        CaioPlayer caioPlayer;
        CaioEnemy caioEnemy;
        Texture2D fundodetela;

        public Level_Caio(ContentManager Content, GameWindow Window)
        {
            caioPlayer = new CaioPlayer(Content.Load<Texture2D>("LEVEL_CAIO/CaioNave"), new Vector2(368, 532), 1, Window, Content);
            caioEnemy = new CaioEnemy(Content.Load<Texture2D>("LEVEL_CAIO/enemy"), new Vector2(500,500));
            fundodetela = Content.Load<Texture2D>("LEVEL_CAIO/background");
        }

        public void Update(GameTime gameTime, KeyboardState teclado, KeyboardState teclado_anterior)
        {
            for (int i = 0; i < Shoot.list.Count; i++)
            {
                Shoot.list[i].Update(gameTime);
            }

            caioPlayer.Update(gameTime, teclado, teclado_anterior);
            caioEnemy.Update(gameTime);
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(fundodetela, Vector2.Zero, Color.White);

            for (int i = 0; i < Shoot.list.Count; i++)
            {
                Shoot.list[i].Draw(gameTime, spriteBatch);
            }
            caioPlayer.Draw(gameTime, spriteBatch);
            caioEnemy.Draw(gameTime, spriteBatch);

        }
    }
}
